import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import Dashboard from '../views/Dashboard.vue'
import GoodsInfo from '../views/GoodsInfo.vue'
import BannerConfig from '../views/BannerConfig.vue'
import PersonalInfo from '../views/PersonalInfo.vue'
import ChangePwd from '../views/ChangePwd.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Login',
        component: Login
    },
    {
        path: '/home',
        name: 'Home',
        component: Home,
        children: [
            {
                path: '/dashboard',
                name: 'Dashboard',
                component: Dashboard
            },
            {
                path: '/goodsInfo',
                name: 'GoodsInfo',
                component: GoodsInfo
            },
            {
                path: '/bannerConfig',
                name: 'BannerConfig',
                component: BannerConfig
            },
            {
                path: '/personalInfo',
                name: 'PersonalInfo',
                component: PersonalInfo
            },
            {
                path: '/changePwd',
                name: 'ChangePwd',
                component: ChangePwd
            }
        ]
    },

]

const router = new VueRouter({
    routes
})

export default router
